package com.yunjian.core.busi.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yunjian.core.busi.mapper.EmployeeMapper;
import com.yunjian.core.busi.model.Employee;
import com.yunjian.core.busi.model.EmployeeExample;
import com.yunjian.core.busi.service.EmployeeService;
import com.yunjian.core.busi.vo.EmployeeVo;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author tsh721@126.com
 */
@Service
public class EmployeeServiceImpl implements EmployeeService {

//private final static Logger logger = LoggerFactory.getLogger(EmployeeInfoServiceImpl.class);
    @Autowired
    private EmployeeMapper mapper;

    @Override
    public int countByExample(EmployeeExample example) {
        return mapper.countByExample(example);
    }

    @Override
    public int deleteByExample(EmployeeExample example) {
        return mapper.deleteByExample(example);
    }

    @Override
    public int deleteByPrimaryKey(String userId) {
        return mapper.deleteByPrimaryKey(userId);
    }

    @Override
    public int insert(Employee record) {
        return mapper.insert(record);
    }

    @Override
    public int insertSelective(Employee record) {
        return mapper.insertSelective(record);
    }

    @Override
    public List<Employee> selectByExample(EmployeeExample example) {
        return mapper.selectByExample(example);
    }

    @Override
    public Employee selectByPrimaryKey(String userId) {
        return mapper.selectByPrimaryKey(userId);
    }

    @Override
    public int updateByExampleSelective(Employee record, EmployeeExample example) {
        return mapper.updateByExampleSelective(record, example);
    }

    @Override
    public int updateByExample(Employee record, EmployeeExample example) {
        return mapper.updateByExample(record, example);
    }

    @Override
    public int updateByPrimaryKeySelective(Employee record) {
        return mapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Employee record) {
        return mapper.updateByPrimaryKey(record);
    }

    @Override
    public PageInfo<Employee> selectPagedByExample(int page, int rows,
            EmployeeExample example) {
        PageHelper.startPage(page, rows);
        PageInfo<Employee> pageInfo = new PageInfo<>(mapper.selectByExample(example));
        return pageInfo;
    }

    @Override
    public List<EmployeeVo> selectVo(EmployeeExample example) {
        return mapper.selectVo(example);
    }

    @Override
    public EmployeeVo selectVoByPrimaryKey(String userId) {
        return mapper.selectVoByPrimaryKey(userId);
    }

}
